1. Field of the Invention
The present invention relates to an information processing apparatus that is connectable to an external device (peripheral device) via an interface.
2. Related Background Art
Conventionally, a Universal Serial Bus (USB) interface has been used to establish a connection between a host apparatus and an external device. When a host apparatus is connected to an external device, the host apparatus detects the connection of the external device to a USB interface, through a device driver for example, and performs a process to make the external device accessible. When the host apparatus receives an instruction to disconnect the external device from an operator, the host apparatus performs processing for shifting a state that the external device can be disconnected therefrom. If the external device is physically disconnected from the host apparatus, the host apparatus detects the disconnection of the external device from the USB interface using a device driver for example, and performs processing for shifting a state that the external device is disconnected therefrom.
In such a system, sometimes an unintended event, for example static electricity is applied to the external device, may accidentally happen and make the electrical connection between the host apparatus and the external device temporarily disconnected. In such a case, a turn-off and restart of the host computer is necessary and a recovery may take long time. To address this problem, Japanese Patent Application Laid-Open No. 2003-131956 discusses a technique in which a circuit of a general interface for transmission and reception of data between a host apparatus and an external device is restarted. Japanese Patent Application Laid-Open No. 2008-27379 discusses a technique for restarting a device control module in a host apparatus.
In the conventional techniques, when an information processing apparatus such as a host apparatus is electrically disconnected temporarily from an external device due to static electricity for example, a device control module is restarted to reset the external device to a connection state. Such approach to recover the connection, however, does not store the previous connection state of the external device before the disconnection. Thus, even when the device control module is restarted to connect the host apparatus to the external device again, the restored connection state is not always the same state before the disconnection. In this case, when the host apparatus attempts to access the external device based on the connection state before disconnection, the host apparatus may not be able to access the external device due to a mismatch between the connection states before and after the disconnection.